Skip to content

fix(api): alias timeout to request_timeout and handle bare gateway er… - #247

Merged
luk384090-cloud merged 2 commits into
mainfrom
dev/v2.1.2-3
Nov 26, 2026
Merged

luk384090-cloud merged 2 commits into
mainfrom
dev/v2.1.2-3

Conversation

@luk384090-cloud

Copy link
Copy Markdown
Collaborator

…rors

  • Treat the 'timeout' keyword as an alias for 'request_timeout' in the client
  • Log warnings when both 'timeout' and 'request_timeout' are provided
  • Prevent 'timeout' from being forwarded as a model parameter
  • Improve error messages for bare gateway responses with empty body and no content-type
  • Extract and expose 'x-request-id' header in error responses for better diagnostics
  • Add regression tests for timeout aliasing and bare gateway error handling in both sync and async cases
  • Include end-to-end tests verifying timeout enforcement and diagnostic error surfacing

Description

[Describe what this PR does and why]

Related Issue: Fixes #[issue_number] or Relates to #[issue_number]

Security Considerations: [Check if API keys or sensitive credentials are exposed in code/logs]

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Model
  • Application
  • Common
  • Documentation
  • Tests
  • CI/CD

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

Testing

[How to test these changes]

Additional Notes

[Optional: any other context]

luk384090-cloud added 2 commits November 26, 2026 17:17
…rors

- Treat the 'timeout' keyword as an alias for 'request_timeout' in the client
- Log warnings when both 'timeout' and 'request_timeout' are provided
- Prevent 'timeout' from being forwarded as a model parameter
- Improve error messages for bare gateway responses with empty body and no content-type
- Extract and expose 'x-request-id' header in error responses for better diagnostics
- Add regression tests for timeout aliasing and bare gateway error handling in both sync and async cases
- Include end-to-end tests verifying timeout enforcement and diagnostic error surfacing
- Adjust response content assignment formatting in test for clarity
- Verify that response message retains raw HTML content
- Confirm that request ID is correctly extracted from bare response
- Ensure no parameter leakage to wire body during timeout scenarios
@luk384090-cloud
luk384090-cloud merged commit c4e985a into main Nov 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant